﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace EmprestaAE.MVVM.Model
{
    [KnownType(typeof(EmprestaAE.MVVM.Model.Borrowing))]
    [DataContractAttribute]
    public class Lending : ModelBase
    {
        [DataMember()]
        private int id;

        public int ID
        {
            get { return id; }
            set { if (id != value) { id = value; RaisePropertyChanged("ID"); } }
        }
        [DataMember()]
        private Person person;

        public Person Person
        {
            get { return person; }
            set { if (person != value) { person = value; RaisePropertyChanged("Person"); } }
        }
        [DataMember()]
        private Thing thing;

        public Thing Thing
        {
            get { return thing ?? (thing = new Thing()); }
            set { if (thing != value) { thing = value; RaisePropertyChanged("Thing"); } }
        }
        [DataMember()]
        private DateModel when;

        public DateModel When
        {
            get { return when ?? (when = new DateModel()); }
            set { if (when != value) { when = value; RaisePropertyChanged("When"); } }
        }
        [DataMember()]
        private DateModel until;

        public DateModel Until
        {
            get { return until ?? (until = new DateModel()); }
            set { if (until != value) { until = value; RaisePropertyChanged("Until"); } }
        }

        [DataMember()]
        private bool status;

        public bool Status
        {
            get { return status; }
            set { if (status != value) { status = value; RaisePropertyChanged("Status"); } }
        }
    }
}
